<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>

    <div onclick="posts()">
        1223
    </div>

<script>

    function posts(){
        //建立子窗口引用(句柄也可是contentWindow)
        var origin = window.open('http://192.168.3.77:8080/src/view/',"_blank")
        setTimeout(function(){
            //推送数据
            origin.postMessage('发到子窗口页面的消息',"*")
        },3000)

    }
    window.addEventListener('message',function(e){
        console.log('已监听到子窗口事件: ',e);
        if(e.origin == 'http://me.api.com'){
            //to do something
            console.log(e.data)
        }
    },false);

</script>
</body>
</html>